package com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.core;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.TinyShardingAsyncService;
import com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.annotaion.TinyShardingJdbcVo;
import org.apache.ibatis.plugin.Invocation;

import java.util.HashMap;
import java.util.List;

/**
 * 如果你需要制作新的规则---只需要实现这个返回表名后缀和表列表 添加新类型Clz
 */
public interface TypeProcessor {

    /**
     * 获取表名
     */
    List<String> getTableName(String tableStart, String tableEndDate, String tablePrefix, String fileValue, TinyShardingJdbcVo tinyShardingJdbcVo, Invocation invocation);

    /**
     * 获取表名后缀
     */
    String getTableNameSuffix(String fileValue, TinyShardingJdbcVo tinyShardingJdbcVo, Invocation invocation);


    Object orderByProcessor(
            TinyShardingAsyncService shardingAsyncService, HashMap<String, Long> totalCountMap,
            List<String> table,
            String tablePrefix,
            String doDataSql,
            IPage<?> page,
            long totalCount);


}
